home *** CD-ROM | disk | FTP | other *** search
/ Delphi Informant Complete 1995 - 2000 / Delphi Informant Complete 1995 to 2000.iso / Delphi Informant Magazine Complete Works SOURCE CODE 1998.rar / 1998 / Mar / DI9803DM / common / Objsafe.pas < prev   
Encoding:
Pascal/Delphi Source File  |  1997-12-01  |  2.1 KB  |  53 lines

  1. //=--------------------------------------------------------------------------=
  2. // ObjSafe.h
  3. //=--------------------------------------------------------------------------=
  4. // (C) Copyright 1995-1996 Microsoft Corporation.  All Rights Reserved.
  5. // Delphi translation by Dan Miser - 5/30/97
  6. unit ObjSafe;
  7.  
  8. interface
  9.  
  10. uses
  11.   Windows;
  12.  
  13. //=--------------------------------------------------------------------------=
  14. //
  15. //  Contents:   IObjectSafety definition
  16. //
  17. //
  18. //  IObjectSafety should be implemented by objects that have interfaces which
  19. //      support "untrusted" clients (for example, scripts). It allows the owner of
  20. //      the object to specify which interfaces need to be protected from untrusted
  21. //      use. Examples of interfaces that might be protected in this way are:
  22. //
  23. //      IID_IDispatch           - "Safe for automating with untrusted automation client or script"
  24. //      IID_IPersist*           - "Safe for initializing with untrusted data"
  25. //      IID_IActiveScript       - "Safe for running untrusted scripts"
  26. //
  27. //---------------------------------------------------------------------------=
  28. type
  29.   {IObjectSafety interface}
  30.   IObjectSafety = interface(IUnknown)
  31.     ['{CB5BDC81-93C1-11cf-8F20-00805F2CD064}']
  32.     function GetInterfaceSafetyOptions(const riid: TGUID;
  33.       out pdwSupportedOptions: DWORD; out pdwEnabledOptions: DWORD) : HResult; stdcall;
  34.     function SetInterfaceSafetyOptions(const riid : TGUID;
  35.       const dwOptionSetMask: DWORD; const dwEnabledOptions: DWORD) : HResult; stdcall;
  36.   end;
  37.  
  38. // Option bit definitions for IObjectSafety:
  39. const
  40.   INTERFACESAFE_FOR_UNTRUSTED_CALLER    = 1;    // Caller of interface may be untrusted
  41.   INTERFACESAFE_FOR_UNTRUSTED_DATA      = 2;    // Data passed into interface may be untrusted
  42.  
  43.   IID_IObjectSafety : TGUID = (
  44.     D1:$cb5bdc81;D2:$93c1;D3:$11cf;D4:($8f,$20,$00,$80,$5f,$2c,$d0,$64));
  45.  
  46. const
  47.   CATID_SafeForScripting: TGUID = '{7DD95801-9882-11CF-9FA9-00AA006C42C4}';
  48.   CATID_SafeForInitializing: TGUID = '{7DD95802-9882-11CF-9FA9-00AA006C42C4}';
  49.  
  50. implementation
  51.  
  52. end.
  53.